/**
 * Copyright (C) 2010 Cloudfarming <info@cloudfarming.nl>
 *
 * Licensed under the Eclipse Public License - v 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.eclipse.org/legal/epl-v10.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package nl.cloudfarming.client.geoviewer;

import org.openide.util.Lookup;
import org.openide.util.lookup.AbstractLookup;
import org.openide.util.lookup.InstanceContent;

/**
 *
 * @author Timon Veenstra
 */
public class MapControllerLookup extends Lookup{

    private static final InstanceContent lookupContent = new InstanceContent();
    private static final Lookup lookup = new AbstractLookup(lookupContent);
    private static final MapControllerLookup instance = new MapControllerLookup();

    public static Result<MapController> getLookupResult() {
        return lookup.lookupResult(MapController.class);
    }

    static Lookup getLookup() {
        return lookup;
    }

    public static MapControllerLookup getInstance(){
        return instance;
    }

    public static void addMapController(MapController mapController){
        lookupContent.add(mapController);
    }

    public static void removeMapController(MapController mapController){
        lookupContent.remove(mapController);
    }

    private MapControllerLookup(){

    }

    @Override
    public <T> T lookup(Class<T> clazz) {
        return lookup.lookup(clazz);
    }

    @Override
    public <T> Result<T> lookup(Template<T> template) {
        return lookup.lookup(template);
    }

  



}
